<?php
namespace App\Logics;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\SupplierModel;

//逻辑处理
class SupplierLogic extends BaseLogic {


    public function __construct()
    {
        parent::__construct();

    }

    public static function getSupplier($fields=['id','name']){

        $where=[

        ];
        $data= SupplierModel::where($where)->select($fields)->get();
        return ob_to_array($data);
    }

    //判断该数据是否存在
    public static function isOne($id){
        $id=(int)$id;
        return SupplierModel::where("id",$id)->count();
    }

    //获得一条数据
    public static function getOne($id,$fields=['*']){
        $id=(int)$id;
        $data= SupplierModel::where("id",$id)->first();
        return ob_to_array($data);
    }





}
